﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="usershoppinginfo.aspx.cs" Inherits="YXShop.Web.admin.include.usershoppinginfo" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>无标题页</title>
    <link href="../style/admin.css" rel="stylesheet" type="text/css" />
    <script src="../../scripts/prototype.js" type="text/javascript"></script>
    <script src="../../scripts/ordervalidate.js" type="text/javascript"></script>
    <script src="../scripts/public.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
function ReturnValue()
{
    var username=document.getElementById("<%=userName.ClientID %>").value;
    var userAddr=document.getElementById("<%=userAddr.ClientID %>").value;
    var userMobile=document.getElementById("<%=userMobile.ClientID %>").value;
    var userFax="";
    var userZip=document.getElementById("<%=userZip.ClientID %>").value;
    var userHome=document.getElementById("<%=userPhone.ClientID %>").value;
    var userEmail=document.getElementById("<%=userEmail.ClientID %>").value;
    var constructionSigns=document.getElementById("<%=txtConstructionSigns.ClientID %>").value;
    var consigneTime=document.getElementById("<%=txtConsigneTime.ClientID %>").value;
    var objProvinces=document.getElementById("Provinces");
	var Provinces=objProvinces.options[objProvinces.selectedIndex].value;
	var objCity=document.getElementById("City");
	var City=objCity.options[objCity.selectedIndex].value;
	var objBorough=document.getElementById("Borough");
	var consigneInfoId=document.getElementById("<%=ConsigneID.ClientID %>").value;
	var putoutTypeId=document.getElementById("<%=PutoutTypeID.ClientID %>").value;
	var putoutId=document.getElementById("<%=PutoutID.ClientID %>").value;
	var Borough;
	if(objBorough.options.length!=0)
	{
	    Borough=objBorough.options[objBorough.selectedIndex].value;
	}
	else
	{
	    Borough="0";
	}
    
    var param = "Option=Save&ProvinceId="+Provinces+"&CitysId="+City+"&BoroughId="+Borough+"&userName="+username+"&userAddr="+userAddr+"&userMobile="+userMobile+"&userFax="+userFax+"&userZip="+userZip+"&userHome="+userHome+"&userEmail="+userEmail+"&ConstructionSigns="+constructionSigns+"&ConsigneTime="+consigneTime+"&ConsigneInfoId="+consigneInfoId+"&PutoutTypeId="+putoutTypeId+"&PutoutId="+putoutId+"";
    var options = 
    { method: 'post',parameters: param,onComplete:
         function(transport)
         {
             var retv = transport.responseText;
             var s =retv.split("partpartpart");
             parent.document.getElementById("ConsignesInfo").innerHTML=s[0];
             parent.document.getElementById("divDeliveryMode").innerHTML = s[1];
             closediv(parent.document.getElementById("LabelDivid"));
         }
    }
    new Ajax.Request('usershoppinginfo.aspx', options);
    
}
function CloseDiv()
{
    parent.document.getElementById("LabelDivid").style.display="none";
}

function onCheck()
{
    if($("Provinces").value=="" || $("City").value=="")
     {
        $("ConsigneeProvince").innerHTML="请选择收货人省份、城市及下属区域！";
        return false;
     }
     else if($("userName").value=="" || $("userAddr").value=="" || $("userZip").value=="" || $("userEmail").value=="" || $("userPhone").value=="" || $("userMobile").value=="")
     {
        $("ConsigneeProvince").innerHTML="请填写收货人信息！";
        return false;
     }
     else
     {
        $("ConsigneeProvince").innerHTML="";
        ReturnValue();
        return true;
     }
}

function onName()
  {       
     if($("userName").value=="")
     {
        $("ConsigneeName").innerHTML="<img src=\'"+getRootPath()+"/images/check_error.gif\'/>&nbsp;此项为必填项，请输入收货人姓名！";
		  $("ConsigneeName").style.color="#000000";
		       return false;
     }else
     {
        $("ConsigneeName").innerHTML="<img src=\'"+getRootPath()+"/images/check_right.gif\'/>";
		        return true;
     }
  }
  
  function onAddress()
  {       
     if($("userAddr").value=="")
     {
        $("ConsigneeAddress").innerHTML="<img src=\'"+getRootPath()+"/images/check_error.gif\'/>&nbsp;此项为必填项，请输入收货详细地址！";
		  $("ConsigneeAddress").style.color="#000000";
		       return false;
     }else
     {
        $("ConsigneeAddress").innerHTML="<img src=\'"+getRootPath()+"/images/check_right.gif\'/>";
		        return true;
     }
  }
  
  function onZip()
  {   
      var reg=/^[0-9]\d{5}$/;
      if(document.getElementById("userZip").value=="")
      {   
          $("zip").innerHTML="<img src=\'"+getRootPath()+"/images/check_error.gif\'/>&nbsp;此项为必填项，请输入邮政编码！";
		  $("zip").style.color="#000000";
		       return false;
      }else if(!reg.test(document.getElementById("userZip").value))
      {  
          $("zip").innerHTML="<img src=\'"+getRootPath()+"/images/check_error.gif\'/>&nbsp;请输入正确的邮政编码";
		  $("zip").style.color="#000000";
		       return false;
      }else
      {
          $("zip").innerHTML="<img src=\'"+getRootPath()+"/images/check_right.gif\'/>";
		        return true;
      }
      
  }
  
    function onEmail()
  {   
      var reg=/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/;
      if(document.getElementById("userEmail").value=="")
      {   
          $("ConsigneeEMail").innerHTML="<img src=\'"+getRootPath()+"/images/check_error.gif\'/>&nbsp;此项为必填项，请输入Email！";
		  $("ConsigneeEMail").style.color="#000000";
		       return false;
      }else if(!reg.test(document.getElementById("userEmail").value))
      {  
          $("ConsigneeEMail").innerHTML="<img src=\'"+getRootPath()+"/images/check_error.gif\'/>&nbsp;请输入正确的Email地址";
		  $("ConsigneeEMail").style.color="#000000";
		       return false;
      }else
      {
          $("ConsigneeEMail").innerHTML="<img src=\'"+getRootPath()+"/images/check_right.gif\'/>";
		        return true;
      }
      
  }

function onPhone()
  {   
      var reg=/(\(\d{3,4}\)|\d{3,4}-|\s)?\d{7,14}/;
      if(document.getElementById("userPhone").value=="")
      {   
          $("ConsigneeTel").innerHTML="<img src=\'"+getRootPath()+"/images/check_error.gif\'/>&nbsp;此项为必填项，请输入座机号码！";
		  $("ConsigneeTel").style.color="#000000";
		       return false;
      }else if(!reg.test(document.getElementById("userPhone").value))
      {  
          $("ConsigneeTel").innerHTML="<img src=\'"+getRootPath()+"/images/check_error.gif\'/>&nbsp;请输入正确的座机号码";
		  $("ConsigneeTel").style.color="#000000";
		       return false;
      }else
      {
          $("ConsigneeTel").innerHTML="<img src=\'"+getRootPath()+"/images/check_right.gif\'/>";
		        return true;
      }
      
  }
  function onFax()
  {
     var reg=/^[+]{0,1}(\d){1,3}[ ]?([-]?((\d)|[ ]){1,12})+$/;
     if($("userFax").value=="")
     {
        $("fax").innerHTML="<img src=\'"+getRootPath()+"/images/check_error.gif\'/>&nbsp;此项为必填项，请输入传真号码！";
		  $("fax").style.color="#000000";
		       return false;
     }else if(!reg.test($("userFax").value))
     {
        $("fax").innerHTML="<img src=\'"+getRootPath()+"/images/check_error.gif\'/>&nbsp;请输入正确的传真号码！";
	   $("fax").style.color="#000000";
		       return false;
     }else
     {
        $("fax").innerHTML="<img src=\'"+getRootPath()+"/images/check_right.gif\'/>";
		        return true;
     }
  }
  
    function onTel()
  {
     var reg=/^((\(\d{3}\))|(\d{3}\-))?13\d{9}|15[89]\d{8}$/;  
     if($("userMobile").value=="")
     {
        $("mobile").innerHTML="<img src=\'"+getRootPath()+"/images/check_error.gif\'/>此项为必填项，请输入手机号码！";
		  $("mobile").style.color="#000000";
		       return false;
     }else if(!reg.test($("userMobile").value))
     {
        $("mobile").innerHTML="<img src=\'"+getRootPath()+"/images/check_error.gif\'/>&nbsp;请输入正确的手机号码！";
	   $("mobile").style.color="#000000";
		       return false;
     }else
     {
        $("mobile").innerHTML="<img src=\'"+getRootPath()+"/images/check_right.gif\'/>";
		        return true;
     }
  }
</script>
</head>
<body>
    <form id="form1" runat="server">
        <div>
         <table style="width: 100%;" class="form_table_input">
            <tr>
                <td style="width: 100%;" runat="server" id="tdContent">
                        <table class="tliy_yy">
                            <tr>
                                <td align="right">配送区域：</td>
                                <td><asp:Literal ID="Literal1" runat="server"></asp:Literal><span id='ConsigneeProvince' style="color:#FF0000; margin:0 0 0 5px;"></span></td>
                            </tr>
                            <tr>
                                <td align="right" width="20%">收货人姓名：</td>
                                <td>
                                    <input type="text" id='userName' style='size:12px;' runat="server" onblur="onName()" />
                                    <span id='ConsigneeName' style="color:#FF0000; margin:0 0 0 50px; text-align:left;"></span>
                                </td>
                            </tr>
                            <tr>
                                <td align="right">联系人电话：</td>
                                <td>
                                    <input type="text"  id='userPhone' style='size:12px;' runat="server" onblur="onPhone()" />
                                    <span id='ConsigneeTel' style="color:#FF0000; margin:0 0 0 50px;"></span>
                                </td>
                            </tr>
                            <tr>    
                                <td align="right">邮编：</td>
                                <td>
                                    <input type="text"  id='userZip' style='size:12px;'  runat="server" onblur="onZip()"/>
                                    <span id="zip" style="color:#FF0000; margin:0 0 0 50px;"></span>
                                </td>
                            </tr>
                            <tr>    
                                <td align="right">联系手机：</td>
                                <td>
                                    <input type="text" id='userMobile' style='size:12px;'  runat="server" onblur="onTel()"/>
                                    <span id="mobile" style="color:#FF0000; margin:0 0 0 50px;">&nbsp;</span>
                                </td> 
                            </tr>
                            <tr>    
                                <td align="right">E-mail：</td>    
                                <td>
                                    <input type="text" id='userEmail' style='size:12px;'  runat="server" onblur="onEmail()"/>
                                    <span id='ConsigneeEMail' style="color:#FF0000; margin:0 0 0 50px;"></span>
                                </td>
                            </tr>
                            <tr>    
                                <td align="right">详细地址：</td>
                                <td>
                                    <input type="text"  id='userAddr' style='size:12px;'  runat="server" onblur="onAddress()"/>
                                    <span id='ConsigneeAddress' style="color:#FF0000; margin:0 0 0 50px;"></span>
                                </td>
                            </tr>
                            <tr>    
                                <td align="right">建筑标志：</td>
                                <td>
                                    <input type="text"  id='txtConstructionSigns' style='size:12px;'  runat="server" onblur="onAddress()"/>
                                    <span id='SpantxtConstructionSigns' style="color:#FF0000; margin:0 0 0 50px;"></span>
                                </td>
                            </tr>
                            <tr>    
                                <td align="right">最佳送货时间：</td>
                                <td>
                                    <input type="text"  id='txtConsigneTime' style='size:12px;'  runat="server" onblur="onAddress()"/>
                                    <span id='SpantxtConsigneTime' style="color:#FF0000; margin:0 0 0 50px;"></span>
                                </td>
                            </tr>
                            <tr>
                                <td style="text-align:center" align="center" colspan="2">
                                    <input name="ConsigneID" id="ConsigneID" type="hidden" value="0" runat="server"/>
                                    <input name="PutoutTypeID" id="PutoutTypeID" type="hidden" value="0" runat="server"/>
                                    <input name="PutoutID" id="PutoutID" type="hidden" value="0" runat="server"/>
                                    <input type="button" id="Button2" value="确 定" onclick="onCheck()"/>
                                </td>
                            </tr>
                        </table>
                </td>
            </tr>
        </table>
        </div>
    </form>
</body>
</html>